<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log(1 + 1)  //2

        console.log("1" + "1")  //11

        console.log(1 + "1")  //1

        //隐式转换
        //true -->1
        //false -->0
        console.log(1 + true)  //2
        console.log(1 + fasle)  //1

        //string 类型和布尔类型，字符串拼接
        console.log("1" + true)  //1true
        console.log("1" + false)  //1false

        //乘法默认将数值转为number类型
        console.log(1 * 1) //1
        console.log(1 * "1") //1
        console.log("1" * "1") //1
        
        console.log(1 * true) //1
        console.log(1 * false) //0

        console.log(1 * '1a') //NaN -->不是数值
        
        console.log(1 + null) //1 --> null转化为0

        console.log(1 + undefined) //NaN -->无法隐式转换


    </script>
</body>
</html>